/**
 * Copyright (c) 2015-2016, Michael Yang 杨福海 (fuhai999@gmail.com).
 *
 * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/licenses/lgpl-3.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.wzgl.core.baseModel;

import java.util.Date;

import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.ehcache.CacheKit;
import com.jfinal.plugin.ehcache.IDataLoader;
import com.wzgl.core.base.JModel;
import com.wzgl.message.MessageKit;

/**
 *  Auto generated by JPress, do not modify this file.
 */
@SuppressWarnings("serial")
public abstract class BaseWxGird<M extends BaseWxGird<M>> extends JModel<M> implements IBean {

	public static final String CACHE_NAME = "wx_grid";
	public static final String METADATA_TYPE = "wx_grid";

	public static final String ACTION_ADD = "wx_grid:add";
	public static final String ACTION_DELETE = "wx_grid:delete";
	public static final String ACTION_UPDATE = "wx_grid:update";
	
	public void removeCache(Object key){
		if(key == null) return;
		CacheKit.remove(CACHE_NAME, key);
	}

	public void putCache(Object key,Object value){
		CacheKit.put(CACHE_NAME, key, value);
	}

	public M getCache(Object key){
		return CacheKit.get(CACHE_NAME, key);
	}

	public M getCache(Object key,IDataLoader dataloader){
		return CacheKit.get(CACHE_NAME, key, dataloader);
	}



	@Override
	public boolean equals(Object o) {
		if(o == null){ return false; }
		if(!(o instanceof BaseWxGird<?>)){return false;}

		BaseWxGird<?> m = (BaseWxGird<?>) o;
		if(m.getFid() == null){return false;}

		return m.getFid().compareTo(this.getFid()) == 0;
	}

	@Override
	public boolean save() {
		boolean saved = super.save();
		if (saved) { MessageKit.sendMessage(ACTION_ADD, this); }
		return saved;
	}

	@Override
	public boolean delete() {
		boolean deleted = super.delete();
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean deleteById(Object idValue) {
		boolean deleted = super.deleteById(idValue);
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean update() {
		boolean update = super.update();
		if (update) { MessageKit.sendMessage(ACTION_UPDATE, this); }
		return update;
	}

	public void setFid(java.lang.String id) {
		set("fid", id);
	}

	public java.lang.String getFid() {
		Object id = get("fid");
		if (id == null)
			return null;
		return id.toString();
	}

	public String getFactivity_name(){
		return get("factivity_name");
	}
	public void setFactivity_name(String factivity_name){
		set("factivity_name",factivity_name);
	}
	
	public String getFpost_date(){
		return get("fpost_date");
	}
	public void setFpost_date(String fpost_date){
		set("fpost_date",fpost_date);
	}
	
	public String getFpost_user(){
		return get("fpost_user");
	}
	public void setFpost_user(String fpost_user){
		set("fpost_user",fpost_user);
	}
	
	public void setFjs_content(String fjs_content){
		set("fjs_content",fjs_content);
	}
	public String getFjs_content(){
		return get("fjs_content");
	}
	

	public String getFcss() {
		return get("fcss");
	}

	public void setFcss(String fcss) {
		set("fcss",fcss);
	}

	public String getFurl() {
		return get("furl");
	}

	public void setFurl(String furl) {
		set("furl",furl);
	}

	public Date getFdate() {
		return get("fdate");
	}

	public void setFdate(Date fdate) {
		set("fdate",fdate);
	}

	public String getFlogo() {
		return get("flogo");
	}

	public void setFlogo(String flogo) {
		set("flogo",flogo);
	}

	public String getFqrcode() {
		return get("fqrcode");
	}

	public void setFqrcode(String fqrcode) {
		set("fqrcode",fqrcode);
	}

	public String getFxz() {
		return get("fxz");
	}

	public void setFxz(String fxz) {
		set("fxz",fxz);
	}

	public String getFtype() {
		return get("ftype");
	}

	public void setFtype(String ftype) {
		set("ftype",ftype);
	}

	public String getFreleaseid() {
		return get("freleaseid");
	}

	public void setFreleaseid(String freleaseid) {
		set("freleaseid",freleaseid);
	}

}
